package com.wkq.util

import android.content.ContentProvider
import android.content.ContentValues
import android.content.Context
import android.database.Cursor
import android.net.Uri

/**
 *
 *@Author: wkq
 *
 *@Time: 2025/4/8 16:28
 *
 *@Desc: 全局的Application
 */
internal  class AppCommonProvider : ContentProvider(){

    override fun onCreate(): Boolean {
        init(context!!)
        return true
    }

    override fun query(
        uri: Uri, projection: Array<out String>?, selection: String?,
        selectionArgs: Array<out String>?, sortOrder: String?
    ): Cursor? {
        return null
    }

    override fun getType(uri: Uri): String? {
        return null
    }

    override fun insert(uri: Uri, values: ContentValues?): Uri? {
        return null
    }

    override fun delete(uri: Uri, selection: String?, selectionArgs: Array<out String>?): Int {
        return -1
    }

    override fun update(
        uri: Uri, values: ContentValues?, selection: String?, selectionArgs: Array<out String>?
    ): Int {
        return -1
    }

    // 其他方法直接 return
}
// Context.kt
private  var application : Context?=null

fun init(context : Context){
    application = context
}

fun AppCommonApplication  () : Context{
    return application!!
}